---
sidebar_label: Roll back applied Migrations (config v2)
sidebar_position: 3
description: Roll back Hasura Migrations
keywords:
  - hasura
  - docs
  - migration
  - roll back
---

# Roll Back Applied Migrations (config v2)

## Introduction

If there are any issues with changes made to the DB schema and Hasura
Metadata it is possible to roll back their state to a previous stable
version.

:::info Note

For `config v3`, see [Rolling back applied Migrations (config v3)](/migrations-metadata-seeds/manage-migrations.mdx#roll-back-migrations).

:::

## Rolling back database schema

Database schema rollbacks can be achieved via the `down` Migrations
generated every time a schema change is made.

Here are some example scenarios:

To roll back a particular migration version:

```bash
hasura migrate apply --version 1550925483858 --type down
```

To roll back the last 2 migration versions:

```bash
hasura migrate apply --down 2
```

:::info Note

Rollbacks will only work if there are `down` Migrations defined for a
schema change.

e.g. The Console will not generate `down` Migrations for SQL statements
executed from the `SQL` tab.

:::

## Rolling back Hasura Metadata

As Hasura Metadata is managed via snapshots of the metadata, to roll
back Hasura Metadata to a particular state you need the metadata
snapshot at that point. This is typically achieved by marking stable
checkpoints of a project in version control via commits.

```bash
git checkout <stable-feature-commit>

hasura metadata apply
```
